import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component:()=>import('../components/Home.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "about" */ '../components/Home.vue'),
    children:[
      {
        path:'/jichu',
        name:'jichu',
        component:()=>import('../components/Jichu.vue')
      },
      {
        path:'/caigou',
        name:'caigou',
        component:()=>import('../components/Caigou.vue')
      },
      {
        path:'/kucun',
        name:'kucun',
        component:()=>import('../components/Kucun.vue')
      },
      {
        path:'/xiaoshou',
        name:'xiaoshou',
        component:()=>import('../components/Xiaoshou.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../components/Login.vue')
  }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
